//
//  CTPFlickrParser.m
//  citipad
//
//  Created by Chih Yuan Liu on 2/22/11.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import "CTPFlickrParser.h"
#import "JSON.h"

@implementation CTPFlickrParser

-(NSMutableArray*) parse:(NSString*) data{
	//NSLog(@"%@", data);
	NSDictionary *dictionary = [data JSONValue];
	NSArray *jdata = [dictionary objectForKey:@"data"];
	NSEnumerator *enumerator = [jdata objectEnumerator];
	NSDictionary* item;
	NSMutableArray* array = [[NSMutableArray alloc] init];
	while (item = (NSDictionary*)[enumerator nextObject]) {
		[array addObject:[item objectForKey:@"url"]];
	}
	return array;
}

@end
